package com.company.ThreadDemo;

public class PriorityDemo extends Thread{
    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName()+"-->"+Thread.currentThread().getPriority());
        PriorityDemo t1 = new PriorityDemo();
        t1.start();
        PriorityDemo t2 = new PriorityDemo();
        t2.setPriority(10);
        t2.start();
        PriorityDemo t3 = new PriorityDemo();
        t3.setPriority(2);
        t3.start();
        PriorityDemo t4 = new PriorityDemo();
        t4.setPriority(5);
        t4.start();
        PriorityDemo t5 = new PriorityDemo();
    }
    @Override
    public void run(){
        System.out.println(Thread.currentThread().getName()+"-->"+Thread.currentThread().getPriority());
    }
}
